<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>电子签名工具</title>
    <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body>
    <div class="container">
        <header>
            <h1><i class="fas fa-signature"></i> 电子签名工具</h1>
            <p>在下方区域绘制您的签名，点击确定生成签名图片</p>
        </header>

        <main>
            <div class="signature-pad-container">
                <canvas id="signaturePad" width="600" height="300"></canvas>
                <div class="signature-pad-actions">
                    <button id="clearBtn" class="action-btn"><i class="fas fa-eraser"></i> 清除</button>
                    <button id="undoBtn" class="action-btn"><i class="fas fa-undo"></i> 撤销</button>
                    <div class="pen-settings">
                        <div class="pen-color">
                            <label for="penColor">颜色:</label>
                            <input type="color" id="penColor" value="#000000">
                        </div>
                        <div class="pen-size">
                            <label for="penSize">粗细:</label>
                            <input type="range" id="penSize" min="1" max="10" value="2">
                        </div>
                    </div>
                    <button id="saveBtn" class="primary-btn"><i class="fas fa-check"></i> 确定</button>
                </div>
            </div>

            <div class="result-container" id="resultContainer">
                <h2>生成的签名</h2>
                <div class="signature-result" id="signatureResult">
                    <!-- 生成的签名图片将在这里显示 -->
                </div>
                <div class="result-actions">
                    <button id="downloadBtn" class="primary-btn"><i class="fas fa-download"></i> 下载</button>
                    <button id="copyBtn" class="action-btn"><i class="fas fa-copy"></i> 复制</button>
                </div>
            </div>
        </main>

        <div class="saved-signatures" id="savedSignatures">
            <h2>历史签名</h2>
            <div class="saved-signatures-container" id="savedSignaturesContainer">
                <!-- 保存的签名将在这里显示 -->
            </div>
        </div>

        <footer>
            <p>© 2025 电子签名工具 | 设计与开发</p>
        </footer>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/signature_pad@4.0.0/dist/signature_pad.umd.min.js"></script>
    <script src="script.js"></script>
</body>
</html>